package com.cloud.salon.client.menber.repository;

import com.cloud.salon.common.base.entity.menber.Account;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

/*
 * @Description 顾客仓库接口
 * @Author wolf--LZH
 * @CreateDate 2019/4/26 0026 下午 10:01
 */
public interface AccountRepository extends JpaRepository<Account, Integer> {

    @Modifying
    @Transactional
    @Query(value = "update Account set balance = balance + ?2 where id = ?1 ")
    Integer setBalance(Integer accountId, Double balanceDelta);
}